<?php
class DesignChoose extends GetData{

	private $daten;
	private $User_Id;

	public function __construct($match){
		$this->daten = $match;
	}

	public function getWort(RainTPL $design){
		$this->design = $design;
		parent::GetData();
		
		$user = new Db_User();
		
	    if(isset($this->design->post->design)){
	        $user->setDesign($this->ActivUser->id,$this->design->post->design);
	        HTTP::redirect ( BASE_URL . '/Explorer' );
	    }
	    
        $crumb = new Crumb($design);
		$this->design->assign ('css',"DesignExplorer");
		$this->design->assign ('js',"jsHome");
		$this->design->assign ('bcn', $crumb->getCrumb_Name());
		$this->design->assign ('bcrumb',$crumb->getCrumb());		
		
		$navi = new Db_user_page_static();
		$navi = $navi->getNavi("Webseiten","Layouts");		
		$this->design->assign ('navi',$navi);	
		
		$designs = new Db_user_page_design();
		$designs = $designs->getDesigns();
		$userSelectDesign = $user->getSelectetDesign($this->ActivUser->id);
		
		//$thumb = PhpThumbFactory::create('test.jpg');
        //$thumb->adaptiveResize(300, 300);
        //$thumb->save('test.png', 'png');
        if(isset($designs)){
            $this->design->assign ('designs',$designs);
        }
	    if(is_numeric($userSelectDesign->design)){
            $this->design->assign ('select',$userSelectDesign);
        }
        
	    if( $cache = $this->design->cache( $this->design->ln.'/User/Page/design', $expire_time = 0 ) )
		{
		 	echo $cache;
		}
		else
		{
		 	$this->design->draw( $this->design->ln.'/User/Page/design' );
		}
	}

}
?>